{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from geoscilabs.dcip.DC_cylinder import cylinder_app\n",
    "from IPython.display import display\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Purpose \n",
    "\n",
    "For a direct current resistivity (DCR) survey, currents are injected to the earth, and flow. \n",
    "Depending upon the conductivity contrast current flow in the earth will be distorted, and these changes \n",
    "can be measurable on the sufurface electrodes. \n",
    "Here, we focus on a cylinder target embedded in a halfspace, and investigate what are happening in the earth when static currents are injected. Different from a sphere case, which is a finite target, \"coupling\" among Tx, target (conductor or resistor), and Rx will be significanlty different upon various scenarios. \n",
    "By investigating changes in currents, electric fields, potential, and charges upon different geometry of cylinder and survey, Tx and Rx location, we understand geometric effects of the target for DCR survey. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Setup"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://github.com/geoscixyz/geosci-labs/blob/master/images/em/DCR_Setup_Cylinder.png?raw=true\"></img>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Question"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Is the potential difference measured by a dipole over a conductive (/resisitive) target higher or lower compared to the half-space reference?\n",
    "- how do the field lines bend in presence of a conductive (/resistive) target?\n",
    "- Compared to the positive and negative sources (A and B), how are oriented the positive and negative accumulated charges around a conductive (/resistive) target?\n",
    "- How would you describe the secondary fields pattern? Does it remind you of the response of an object fundamental to electromagnetics?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Cylinder app\n",
    "\n",
    "## Parameters:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " - **survey**: Type of survey\n",
    " - **A**: (+) Current electrode  location\n",
    " - **B**: (-) Current electrode  location\n",
    " - **M**: (+) Potential electrode  location\n",
    " - **N**: (-) Potential electrode  location\n",
    " - **r**: radius of cylinder\n",
    " - **xc**: x location of cylinder center\n",
    " - **zc**: z location of cylinder center\n",
    " - **$\\rho_1$**: Resistivity of the halfspace\n",
    " - **$\\rho_2$**: Resistivity of the cylinder\n",
    " - **Field**: Field to visualize\n",
    " - **Type**: which part of the field\n",
    " - **Scale**: Linear or Log Scale visualization"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1c06cc508f8c42269449709e6b6cd27f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "MyApp(children=(ToggleButtons(description='survey', options=('Dipole-Dipole', 'Dipole-Pole', 'Pole-Dipole', 'P…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "app = cylinder_app()\n",
    "display(app)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  },
  "widgets": {
   "state": {
    "6ded20fdcf7f47919b01788041f6cf8b": {
     "views": [
      {
       "cell_index": 8
      }
     ]
    }
   },
   "version": "1.2.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
